import java.sql.DriverManager;

public class ClassLoaderTest1 {
    public static void main(String[] args) {
        try {
            // 1.获取String类的ClassLoader
            ClassLoader classLoader = Class.forName("java.lang.String").getClassLoader();
            System.out.println(classLoader);

            // 2.获取当前线程上下文的ClassLoader
            ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
            System.out.println(contextClassLoader);

            // 3.获取系统的ClassLoader
            ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader();
            System.out.println(systemClassLoader);

        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
    }
}
